package com.wxzhou.wangzhuan.dto;

import jakarta.validation.constraints.*;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 提现请求对象
 */
public class WithdrawRequestDto implements Serializable {

    /**
     * 到账方式，2：微信到账、3支付宝到账，4：银行卡到账
     */
    @NotNull(message = "类型错误，2：微信到账、3支付宝到账，4：银行卡到账")
    @Min(value = 2, message = "类型错误，2：微信到账、3支付宝到账，4：银行卡到账")
    @Max(value = 4, message = "类型错误，2：微信到账、3支付宝到账，4：银行卡到账")
    private Integer type;

    /**
     * 提现金额
     */
    @NotNull(message = "提现金额不能为空")
    @Digits(fraction = 1, integer = 4, message = "金额格式应为4位整数+1位小数")
    @DecimalMin(value = "0", inclusive = false, message = "金额必须大于0")
    private BigDecimal amount;

    public WithdrawRequestDto() {
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }
}
